Dynomotion

Group: DynoMotion Message: 11302 From: tmday7 Date: 4/8/2015
Subject: KmotionCNC adding Jog Button bitmaps
Iam trying to add a custom bitmap image for the down step and the right step buttons.
What i have done so far is add my new bitmap to the res folder and changed the .cpp file to use DownStep bitmap instead of UpStep. And added the IDB indentifier for my new bitmaps.
I get no rebuild errors in Visual Studio but when i launch the KmotionCNC.exe all the step buttons are still using the original upstep and leftstep bitmaps.
What else is there i need to change/add to, or is it a lot more than its worth:)?

Thanks in advance,
Troy


Group: DynoMotion Message: 11304 From: Tom Kerekes Date: 4/8/2015
Subject: Re: KmotionCNC adding Jog Button bitmaps
Hi Troy,

It shouldn't be exceedingly difficult.

Your description of what you did and what you are trying to do is a bit confusing.  Can you be more specific on the individual steps.  Did you create a new bitmap resource with the Resource editor for the new bitmap files?

Regards
TK

Group: DynoMotion Message: 11308 From: tmday7 Date: 4/8/2015
Subject: Re: KmotionCNC adding Jog Button bitmaps

Hi Tom,

Sorry…mind going faster than fingers. :)


This is my example of trying to add a custom bitmap button to the Z axis step minus. I have already made a custom bitmap and placed in this directory C:\KMotion432\PC VC Examples\KMotionCNC\res. The bitmap name is downstep1.bmp. 


1st) In Visual Studio select Resource View tab.


2) Navigate to KmotionCNC>KmotionCNC.rc>Bitmap


3) Copy & Paste any of bitmaps within the Bitmap folder. And change its IDB to IDB_DownStep.Then in the IDB_DownStep properties,Filename, change to res\downstep.bmp


4)Then I click Solution Explorer tab and navigate to KMotionCNC>Source Files and open KmotionCNCDlg.cpp.


5) I then changed

"m_DownStep.LoadBitmaps(IDB_UpStep,0,0);"

to

"m_DownStep.LoadBitmaps(IDB_DownStep,0,0);"

and

"m_ZminusStep.LoadBitmaps(IDB_UpStep,0,0);"

to

"m_ZminusStep.LoadBitmaps(IDB_DownStep,0,0);"


After this i changed the name of my new bitmap in the C:\KMotion432\PC VC Examples\KMotionCNC\res directory from downstep1.bmp to downstep.bmp.


Then I saved the KmotionCNCDlg.cpp and rebuild KMotionCNC in Visual Studio. I get no errors, but when I launch the KMotionCNC.exe the upstep.bmp is still being used for the Z Axis minus step and not my new downstep.bmp.


Thanks,

Troy

Group: DynoMotion Message: 11315 From: Tom Kerekes Date: 4/8/2015
Subject: Re: KmotionCNC adding Jog Button bitmaps
Hi Troy,

I recall having that type of problem.   I think there is some weird behaviour or bug in VS.  I think it is related to the original intent that you are supposed to create the bitmaps from scratch right within the resource editor (even though it doesn't even handle true color bitmaps).  So it keeps in memory the image rather than going out to the file.  Maybe like a cache.  Then only writes out to the file when it thinks it was edited.  Possibly with a new name it creates.  Or overwriting your new file with the copied data.   I struggle with it each time.  Eventually after a few times of exiting VS, rebuilding, copying over the disk file that it mysteriously changed, etc etc.  Finally it ends up all in sync and working and I can't remember all the steps I did.

Please try a few things and see if you can figure it out.  If not I'll see if I can figure out the proceedure.

Regards
TK

Group: DynoMotion Message: 11318 From: tmday7 Date: 4/8/2015
Subject: Re: KmotionCNC adding Jog Button bitmaps
Hi Tom,
 Here is what appears to be happening for me, dont know if this is the same problem as you decribed. After the Copy&Paste of a IDB_???? and then renaming the copied IDB_???? to my new bmp, the new bitmap that i created beforehand and placed in the C:\KMotion432\PC VC Examples\KMotionCNC\res directory is being replaced with the original bitmap. The fix procedure i found is to just re save my new bitmap from within my RealDraw software and then save all within VS. Next i launch KMotionCNC.exe and my new bitmap is now showing on the step button.

Thanks for the help again,
Troy
Group: DynoMotion Message: 11319 From: tmday7 Date: 4/8/2015
Subject: Re: KmotionCNC adding Jog Button bitmaps
Ill make a PDF of the whole procedure and place it the yahoo files.
Troy
Group: DynoMotion Message: 11321 From: Tom Kerekes Date: 4/8/2015
Subject: Re: KmotionCNC adding Jog Button bitmaps
Troy you are the man.  Thanks for reporting back.

TK